/* 
 *   Date       Developer   Description
 *   
 *
 *   Classname:  zzz.test.component.stream.Test01
 * 
 *   Date:   2014-3-5
 * 
 *   The source code contained in this listing is proprietary to
 *   HLJ POST YITONG INFO-NET CO.,LTD.
 * 
 *   Unauthorized copying, adaptation, distribution, use, or display
 *   is strictly prohibited.
 *   This software is Copyright 2014 HLJ POST YITONG INFO-NET CO.,LTD.
 */
package com.titan.demo.camel.sample.component.stream;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

import com.titan.demo.camel.utils.CamelUtils;


/**
 * 根据用户按键，将内容输出
 */
public class Test01 {

    public static void main(String[] args) {
        CamelContext context = new DefaultCamelContext();
        try {
            RouteBuilder builder = new RouteBuilder() {
                public void configure() throws Exception {
                    from("stream:in?promptMessage=Enter something: ").to("stream:out");
                }
            };
            context.addRoutes(builder);
            context.start();

            Thread.sleep(60 * 1000);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        	CamelUtils.close(context);
        }
    }

}

